local qunxian3__baishoukaiduo_huaifeng = fk.CreateSkill {

  name = "qunxian3__baishoukaiduo_huaifeng",

  tags = {},

}

Fk:loadTranslationTable {
  ["qunxian3__baishoukaiduo_huaifeng"] = "坏风",
  [":qunxian3__baishoukaiduo_huaifeng"] = [[每回合限一次，你造成伤害后。可令任意名其他角色各失去一点体力或令一名其他角色失去两点体力。]],
  ["#qunxian3__baishoukaiduo_huaifeng-choice"] = "坏风：请选择一项发动",
  ["#qunxian3__baishoukaiduo_huaifeng-choose_player_one"] = "坏风：请选择1名其他角色令其失去2点体力",
  ["#qunxian3__baishoukaiduo_huaifeng-choose_player_much"] = "坏风：请选择任意名其他角色令其失去1点体力",
  ["$qunxian3__baishoukaiduo_huaifeng"] = "坏风",
}

qunxian3__baishoukaiduo_huaifeng:addEffect(fk.Damage, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(qunxian3__baishoukaiduo_huaifeng.name) and
        player:usedSkillTimes("qunxian3__baishoukaiduo_huaifeng", Player.HistoryTurn) == 0
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local choice = room:askToChoice(player, {
      choices = { "一名其他角色失去2点体力", "任意名其他角色失去1点体力", "Cancel" },
      cancelable = true,
      skill_name = "qunxian3__baishoukaiduo_huaifeng",
      prompt = "#qunxian3__baishoukaiduo_huaifeng-choice",
    })
    if choice == "Cancel" then return end
    if choice == "一名其他角色失去2点体力" then
      local target_p = room:askToChoosePlayers(player, {
        targets = room:getOtherPlayers(player),
        skill_name = "qunxian3__baishoukaiduo_huaifeng",
        prompt = "#qunxian3__baishoukaiduo_huaifeng-choose_player_one",
        max_num = 1,
        min_num = 1,
        cancelable = true
      })
      if #target_p == 0 then return end
      target_p = target_p[1]
      room:loseHp(target_p, 2, "qunxian3__baishoukaiduo_huaifeng")
    else
      local target_ps = room:askToChoosePlayers(player, {
        targets = room:getOtherPlayers(player),
        skill_name = "qunxian3__baishoukaiduo_huaifeng",
        prompt = "#qunxian3__baishoukaiduo_huaifeng-choose_player_much",
        max_num = #room:getOtherPlayers(player),
        min_num = 1,
        cancelable = true
      })
      if #target_ps == 0 then return end
      for index, target_p in ipairs(target_ps) do
        room:loseHp(target_p, 1, "qunxian3__baishoukaiduo_huaifeng")
      end
    end
  end
})




return qunxian3__baishoukaiduo_huaifeng
